//
//  SPDataHeaderView.m
//  panzer
//
//  Created by 还带大道 on 2018/10/20.
//  Copyright © 2018年 还带大道. All rights reserved.
//

#import "SPDataHeaderView.h"
#import "SPCommon.h"
#import "SPDataCModel.h"

@interface SPDataHeaderView()
@property (weak, nonatomic) IBOutlet UIView *groupView;
@property (weak, nonatomic) IBOutlet UIImageView *imageV;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *live_count;
@property (weak, nonatomic) IBOutlet UILabel *totalSales;
@property (weak, nonatomic) IBOutlet UILabel *count_fans;
@property (weak, nonatomic) IBOutlet UILabel *count_guide;
@property (weak, nonatomic) IBOutlet UILabel *total_livetime;
@property (weak, nonatomic) IBOutlet UILabel *total_sales;

@end

@implementation SPDataHeaderView

+ (instancetype)shareHeaderView
{
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].lastObject;
}


- (void)awakeFromNib
{
    [super awakeFromNib];
    _groupView.backgroundColor = [UIColor whiteColor];
    
    _groupView.layer.shadowColor = RZ_COLOR_ALPHA(226, 226, 226, 0.63).CGColor;
    _groupView.layer.cornerRadius = 8;
    _groupView.layer.shadowOffset = CGSizeMake(0,2);//shadowOffset阴影偏移,x向右偏移，y向下偏移，默认(0, -3)
    _groupView.layer.shadowOpacity = 1;//阴影透明度，默认0
    _groupView.layer.shadowRadius = 7;//阴影半径，默认3
}


- (void)setModel:(SPDataCModel *)model
{
    _model = model;
    _totalSales.text = [NSString stringWithFormat:@"%ld元",model.total_store_saleprice];
    _count_fans.text = [NSString stringWithFormat:@"%ld个",model.total_store_collect];
    _count_guide.text = [NSString stringWithFormat:@"%ld人",model.total_store_livenum];
    _total_livetime.text = [NSString stringWithFormat:@"%ld小时",model.total_store_livetime];
    _total_sales.text = [NSString stringWithFormat:@"%ld件",model.total_store_salenum];
}
@end
